package com.fy.service.server.service;

import com.fy.common.model.im.MessageModel;
import com.fy.common.model.im.UserOnlineStatus;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;

public interface ImService {

    //根据cmd 做业务类型判断 ，调用哪一个业务方法
    void route(MessageModel message, ChannelHandlerContext ctx)  throws Exception;

    //绑定客户端上传的业务参数
    void bindServer(MessageModel message, ChannelHandlerContext ctx) throws Exception;


    //客户端身份权限校验
    void tokenValidat(MessageModel messageModel, ChannelHandlerContext ctx) throws Exception;

    //心跳机制,检测channel的健康度
    void heartCheck(MessageModel message, ChannelHandlerContext ctx) throws Exception;

    //发起聊天
    /**
     *
     * @param message
     * @param fromCmd  对于发送者的响应指令
     * @param toCmd     对于接受者的响应指令
     * @param ctx
     * @throws Exception
     */
    void chat(MessageModel message, String fromCmd, String toCmd, ChannelHandlerContext ctx) throws Exception;

    //正在输入
    void typing(MessageModel message, ChannelHandlerContext ctx) throws Exception;


    //用户上线群信息维护
    void groupOnlineInfo(MessageModel message, UserOnlineStatus onlineStatus);

    //用户下线群信息维护
    void groupOfflineInfo(MessageModel message, UserOnlineStatus onlineStatus);

    //消息已读
    void readMessage(MessageModel message, ChannelHandlerContext ctx)  throws Exception;




}
